﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master"
    CodeBehind="wfFactura.aspx.cs" Inherits="CO.wfFactura" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    
   <link href="../Styles/General.css" rel="stylesheet" type="text/css" />
   <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
   
    <script src="../Scripts/jquery.tokeninput.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.purr.js" type="text/javascript"></script>
    <script src="../Scripts/General.js" type="text/javascript"></script>
  
    <script src="js/global.js" type="text/javascript"></script>

      <script type="text/javascript">
       
         
           function fDevolverSeleccion6(codigo, Descrip) {
               document.getElementById("<%= HddIdEmitidopor.ClientID %>").value = codigo
               document.getElementById("<%= lblEmitidoPor.ClientID %>").value = Descrip
            }
    </script>
    <style type="text/css">
        .auto-style1 {
            height: 22px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

        <input id="dummy" type="button" style="display: none" runat="server" />
   
        <table width="100%" cellpadding="0" cellspacing="2">
            <tr>
                <td>
                  <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
                     <ContentTemplate>
                    <div class="ToolBar" style="height:24px;width:100%">
                        <asp:ImageButton ID="btnGrabar" runat="server" style="width: 14px" ToolTip="Grabar" onclick="btnGrabar_Click"/>
                        <asp:Label ID="Label19" runat="server" Font-Bold="True" ForeColor="Black" Text="Grabar"></asp:Label>     
                        <asp:ImageButton ID="btnSalir" runat="server" style="width: 16px;height:16px" ToolTip="Buscar" onclick="btnSalir_Click" />
                        <asp:Label ID="Label20" runat="server" Font-Bold="True" ForeColor="Black" Text="Salir"></asp:Label>
                        <asp:Label ID="lblMensaje" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                        <asp:Label ID="lblEvaluacion" runat="server" ForeColor="Red"></asp:Label>
                    </div>
                     </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
              <ContentTemplate>
               <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px;-webkit-border-radius: 5px; -ms-border-radius: 5px;">                        
         
                         <table width="100%" cellpadding="0" cellspacing="2">
                            <tr>
                                <td style="width: 5px;">
                                    &nbsp;
                                </td>
                                <td>
                                    <table>
                                        <tr>
                                            <td style="width: 5px;">
                                                Id Documento</td>
                                            <td>
                                                <asp:TextBox ID="txtIdDoc" runat="server" CssClass="esdTextBox" TabIndex="3"></asp:TextBox>
                                                <asp:Label ID="LBLIDDOC" runat="server"></asp:Label>
                                            </td>
                                            <td colspan="2">
                                                &nbsp;</td>
                                            <td>
                                                <asp:Label ID="Label22" runat="server" Text="Fecha OC"></asp:Label>
                                            </td>
                                            <td align="left"> 
                                                <esd:esdDateTextBox ID="ucControlFecha1" runat="server" TabIndex="1" />
                                            </td>
                                            <td align="left">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td style="width: 5px;">&nbsp;
                                                <asp:Label ID="Label1" runat="server" Font-Size="Small" style="font-size: x-small" Text="Fecha Fact"></asp:Label>
                                            </td>
                                            <td>
                                                <esd:esdDateTextBox ID="ucControlFecha2" runat="server" TabIndex="1" />
                                            </td>
                                            <td colspan="2">&nbsp;</td>
                                            <td>&nbsp;
                                                <asp:Label ID="Label11" runat="server" style="font-size: x-small" Text="Id OC"></asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtIdOC" runat="server" CssClass="esdTextBox" TabIndex="4"></asp:TextBox>
                                            </td>
                                            <td align="left">&nbsp;</td>
                                            <td>&nbsp; </td>
                                            <td>&nbsp; </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label2" runat="server" style="font-size: x-small" Text="Documento"></asp:Label>
                                            </td>
                                            <td id="tdValorProv">
                                                <asp:DropDownList ID="dpTipDoc" runat="server" Width="200px"  CssClass="esdTextBox" TabIndex="2"></asp:DropDownList>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td align="right">
                                                &nbsp;
                                            </td>
                                            <td align="left">
                                                &nbsp;
                                            </td>
                                            <td colspan="2">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label21" runat="server" style="font-size: x-small" Text="N°Serie"></asp:Label>
                                            </td>
                                            <td class="style36">
                                                <asp:TextBox ID="txtNumSerie" runat="server" CssClass="esdTextBox" TabIndex="3"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td class="style47">
                                                &nbsp;
                                            </td>
                                            <td align="right">
                                                <asp:Label ID="Label14" runat="server" style="font-size: x-small" Text="Modalidad"></asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:DropDownList ID="dpModalidad" CssClass="esdTextBox" runat="server" Width="200px" TabIndex="8"></asp:DropDownList>
                                            </td>
                                            <td class="style41" colspan="2">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label3" runat="server" style="font-size: x-small" Text="N°Documento"></asp:Label>
                                            </td>
                                            <td>
                                                <input id="HiddPedidoPor" runat="server" name="HiddPedidoPor" size="4" style="width: 56px; height: 0px" type="hidden" />
                                                <asp:TextBox ID="txtNumDoc" runat="server" CssClass="esdTextBox" TabIndex="4"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td align="right">
                                                <asp:Label ID="Label16" runat="server" style="font-size: x-small" Text="Moneda"></asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:DropDownList ID="dpNoneda" runat="server" CssClass="esdTextBox" TabIndex="9" Width="100px"></asp:DropDownList>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label4" runat="server" style="font-size: x-small" Text="Proveedor"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtIdprov" runat="server" CssClass="esdTextBox" Width="200px"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td align="right">
                                                <asp:Label ID="Label17" runat="server" style="font-size: x-small" Text="Tipo de cambio"></asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="txtTipCambio" runat="server" CssClass="esdTextBox" TabIndex="10" Width="50px">0.00</asp:TextBox>
                                            </td>
                                            <td colspan="2">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="auto-style1">
                                                <asp:Label ID="Label6" runat="server" style="font-size: x-small" Text="Emitida por"></asp:Label>
                                            </td>
                                            <td class="auto-style1">
                                                <esd:esdButtonTextBox ID="lblEmitidoPor" Runat="server" Width="200px"></esd:esdButtonTextBox>
                                            </td>
                                            <td class="auto-style1">
                                                </td>
                                            <td align="right" colspan="2" class="auto-style1">
                                                &nbsp;
                                            </td>
                                            <td align="left" colspan="3" class="auto-style1">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label8" runat="server" style="font-size: x-small" Text="Observacion"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtObseracion" runat="server" CssClass="esdTextBox" Height="50px" TabIndex="7" Width="294px"></asp:TextBox>
                                            </td>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td align="right" colspan="2">
                                                &nbsp;
                                            </td>
                                            <td align="left" colspan="3">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                &nbsp;
                                            </td>
                                            <td colspan="7">
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="width: 5px;">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
            
                    </div>
                </ContentTemplate>
         </asp:UpdatePanel>
                </td>
            </tr>
        </table>
  

        <asp:HiddenField ID="hdnidCliProv" runat="server" />
        <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
            <div>
                <div>
                    <input id="hidId" runat="server" name="hidId" size="1" style="width: 32px; height: 22px" type="hidden" />
                    <input id="hdProducto" runat="server" name="hdColor" size="1" style="width: 32px; height: 22px" type="hidden" />
                </div>
                <div style="width: 1100px">
                    <div style="overflow: auto; width: 1100px; height: 201px">
                    <div class="DataDetail">
                       
                            <asp:GridView ID="GVDetalleProducto" runat="server"  ScrollBars="Auto" 
                            ScrollWidth="100%" Width="100%" AutoGenerateColumns="False" 
                            ShowHeaderWhenEmpty="True" 
                                onrowdatabound="GVDetalleProducto_RowDataBound" 
                                onrowcommand="GVDetalleProducto_RowCommand" 
                                onrowdeleting="GVDetalleProducto_RowDeleting"  > 
                            
                           
                            <AlternatingRowStyle CssClass="esdGridAlternativeRowStyle" />
            
                    <Columns>

                        <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkBxSelect" runat="server" />
                                    </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="N°">
                            <ItemTemplate>
                                <asp:TextBox ID="txtNumCorrelativo"  CssClass="esdTextBox"  runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem._Nu_Correla") %>'
                                    Width="50px"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                            <ItemStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="idProducto" Visible="False">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIdproducto" runat="server"  CssClass="esdTextBox"  
                                    Width="100px"  Text='<%# DataBinder.Eval(Container, "DataItem._Codigo") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                            <ItemStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Producto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtDsProducto" runat="server" CssClass="esdTextBox"  
                                    Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._Producto") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>


                            <asp:TemplateField HeaderText="Detalle">
                            <ItemTemplate>
                                <asp:TextBox ID="txtDetalle" runat="server" CssClass="esdTextBox"  
                                    Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._detalle") %>' 
                                    ></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="U.M">
                            <ItemTemplate>
                                <asp:DropDownList ID="dpUM" runat="server" Width="100px" >
                                </asp:DropDownList>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Peso Bruto" Visible="False">

                            <ItemTemplate>
                                <asp:TextBox ID="txtPesoBruto" runat="server" CssClass="esdTextBox"  
                                    Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Peso_Bruto") %>' 
                                    Enabled="False"></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Cant.Pedida">
                            <ItemTemplate>
                                <asp:TextBox ID="txtCantidad" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Cant") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Cant.Recibida">
                            <ItemTemplate>
                                <asp:TextBox ID="txtCantidadRec" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._cantReciv") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                            <asp:TemplateField HeaderText="Cant.Regist">
                            <ItemTemplate>
                                <asp:TextBox ID="txtcantReg" runat="server" CssClass="esdTextBox" Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._cantReg") %>'></asp:TextBox>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="p.Neto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPneto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreNeto") %>'></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="P.U">
                            <ItemTemplate>
                                <asp:TextBox ID="txtPU" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreUnit") %>'></asp:TextBox>
                            </ItemTemplate>
                            <ControlStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Afect.IGV">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkBxIGV" runat="server"  />
                                    </ItemTemplate>
                                <ControlStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                            <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="grdBttCmdCalcular" CommandName="CmdCalc" CommandArgument="<%# Container.DataItemIndex %>"
                                    runat="server" ImageUrl="../Images/Icons/Enabled/Calculator.png" 
                                    ToolTip="Actualizar Totales"/>
                            </ItemTemplate>
                            <HeaderStyle Width="22px" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Dscto">
                            <ItemTemplate>
                                <asp:TextBox ID="txtDscto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Dscto") %>'></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="IGV">
                            <ItemTemplate>
                                <asp:TextBox ID="txtIGV" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Igv") %>'></asp:TextBox>
                            </ItemTemplate>
                                <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Sub. Total">
                            <ItemTemplate>
                                <asp:TextBox ID="txtSubTotal" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._subTotal") %>'></asp:TextBox>
                            </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="%Desc">
                             
                                <ItemTemplate>
                                    <asp:TextBox ID="txtPorDesc"  CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._nu_pordscto") %>'></asp:TextBox>
                                </ItemTemplate>
                            <FooterStyle Font-Size="X-Small" />
                            <HeaderStyle Font-Size="X-Small" />
                        </asp:TemplateField>

                        <asp:TemplateField>
                                <ItemStyle HorizontalAlign="Center" Width="40px" CssClass="etiqueta"></ItemStyle>
                                <ItemTemplate>
                                <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/Icons/Enabled/Delete.png"
                                    CommandName="CmdDel" 
                                    CommandArgument='<%# Container.DataItemIndex%>' ToolTip="Eliminar Registro">
                                </asp:ImageButton>
                            </ItemTemplate>
                            </asp:TemplateField>

                    </Columns>
                        <HeaderStyle CssClass="esdGridHeaderStyle" />
                        <PagerStyle CssClass="gridPagerStyle" />
                        <RowStyle CssClass="esdGridRowStyle" />
                        <SelectedRowStyle CssClass="esdGridSelectedRowStyle" />
                        <EmptyDataTemplate>
                        <div id="gridempty">
                            <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                            &nbsp;No existen registros para esta solicitud.
                        </div>
                    </EmptyDataTemplate>
                </asp:GridView>
              

                </div>
                    </div>
                        <div align="right">
                            <div>
                                <asp:Label ID="lblDsc" runat="server"  Text="Tot.Desc:"></asp:Label> 
                                <asp:TextBox ID="txtDescuento" runat="server" CssClass="esdTextBox"></asp:TextBox>
                            </div>
                            <div>
                                <asp:Label ID="lblIgv" runat="server" Text="Tot.IGV :"></asp:Label>
                                <asp:TextBox ID="txtIgv_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                            </div>
                            <div>
                                <asp:Label ID="lblTotal" runat="server" Text="Total:"></asp:Label>                                       
                                <asp:TextBox ID="txtTotal_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
            <input id="HddIdprov" type="hidden" runat ="server"/>
            <input id="HddIdEmitidopor" type="hidden" runat ="server"/>
            <input id="hddIfac" type="hidden" runat ="server" />
            <input id="HiddEstado" type="hidden" runat ="server" />
            <input id="hddIdOC" type="hidden" runat ="server" />
           
    
            <input id="hddCodigo" type="hidden" runat ="server" />
            <input id="hddPres" type="hidden" runat ="server"/>
            <input id="hddProducto" type="hidden" runat ="server"/>
            <input id="hddPresenta" type="hidden" runat ="server"/>
            <input id="hddUm" type="hidden" runat ="server"/>
            <input id="hddPesoBruto" type="hidden" runat ="server"/>
            <input id="hidVentana" runat="server" name="hidVentana" size="1" style="width: 32px; height: 22px" type="hidden" />
        <asp:HiddenField ID="HiddenField1" runat="server" />
        <%--    </form>
</body>
</html>--%>


</asp:Content>